<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>课程详情</title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script src="./js/bootstrap.min.js"></script>
    <script src="./js/jquerysession.js"></script>
    <script src="./js/bootstrap-datetimepicker.js"></script>
    <script src="./js/fileinput.min.js"></script>

    <link rel="stylesheet" href="./css/bootstrap-datetimepicker.min.css">
    <link href="./css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="./css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
    <link href="./css/templatemo_style.css" rel="stylesheet" type="text/css">
    <link href="./css/fileinput.min.css">

</head>
<body style="background: #e7e7e7; background-size:cover;width: 100%">

<div class="container">
    <!--bar-->
    <div id="myNavbar" class="container">

    </div>

    <div class="container">
        <!--subName-->
        <div class="jumbotron" style="background: url('./images/bg_subInfo.jpg')">
            <h1><span id="subName"></span></h1>
            <p><span id="tName" style="float: left"></span></p>
            <br>
            <p style="float: left">邀请码：<span id="subCode"></span></p>
            <p >
                <a id="btn_openModalAddHome" class="btn btn-primary btn-lg hidden" role="button" style="float:right"
                   data-toggle='modal'
                   data-target='#modalAddHome'>发布作业
                </a>
            </p>
            <br>
        </div>

        <!--homeworkCard-->
        <div class="row" id="div_subInfo">

        </div>

    </div>
</div>
</body>

<!--modal发布作业-->
<div class="modal fade" id="modalAddHome" tabindex="-1" role="dialog"
     aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">发布作业</h4>
            </div>
            <div class="modal-body">
                <p>作业标题：<input type="text" class="form-control" id="modalAddHome_textHomeTitle"></p>
                <p>作业内容：<textarea class="form-control" id="modalAddHome_textHomeItem" rows="5"></textarea></p>
                <p>截止日期：<input type="text" id="modalAddHome_deadLine"></p>
                <script type="text/javascript">
                    $.fn.datetimepicker.dates['zh-CN'] = {
                        days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
                        daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
                        daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
                        months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                        monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                        today: "今天",
                        suffix: [],
                        meridiem: ["上午", "下午"]
                    };
                    var newDate = new Date();
                    var t = newDate.toJSON();
                    //日期插件
                    $("#modalAddHome_deadLine").datetimepicker({
                        language: 'zh-CN',
                        format: 'yyyy-mm-dd',
                        todayHighlight: 1,
                        minView: "month",
                        startView: 2,
                        forceParse: 0,
                        showMeridian: 1,
                        autoclose: 1,
                        startDate: new Date(t)
                    });
                </script>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="modalAddHome_btnSubmit">发布</button>
            </div>
        </div>
    </div>
</div>

<!--modal提交作业-->
<div class="modal fade" id="modalSubmitHome" tabindex="-1" role="dialog"
     aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title">提交作业</h4>
            </div>
            <!--提交表单，上传作业文件-->
            <form method="post" action="/homework/submitHomework" enctype="multipart/form-data">
                <!--额外数据-->
                <!--type="hidden"-->
                <input id="homeworkId" name="homeworkId" value="" type="hidden">
                <input id="stuAccount" name="stuAccount" value="" type="hidden">

                <div class="modal-body">

                    <label>作业内容：
                    <input id="item" name="item" type="text" class="form-control"></label>
                    <br>

                    <label>上传日期：
                    <input name="submitTime" id="modalSubmitHome_submitTime" type="text" readonly="readonly"/></label>
                    <script type="text/javascript">
                        var newDate = new Date();
                        var year = newDate.getFullYear();
                        var month = newDate.getMonth() + 1;
                        var day = newDate.getDate();
                        var date = year + "-" + month + "-" + day;

                        document.getElementById("modalSubmitHome_submitTime").value = date;
                    </script>
                    <br><br>

                    <label class="control-label">文件：</label>
                    <input name="file" id="fileInput" type="file" class="file">
                </div>

                <div class="modal-footer">
                    <input type="button" class="btn btn-default" data-dismiss="modal" value="关闭">
                    <input id="modalSubmitHome_btnSubmit" type="submit" class="btn btn-primary"/>
                </div>

            </form>
        </div>
    </div>
</div>

<script type="text/javascript" , src="js/scriptMyNavbar.js"></script>
<script type="text/javascript" src="js/scriptSubInfo.js"></script>
</html>